package com.sgx.learning.luban.homework;

import java.io.File;
import java.io.IOException;
import java.util.Objects;

public class JavaCompile {

    private static String a = "ss";


    public static void main(String[] args) throws IOException {
        Class<?> clazz = JavaCompile.class;
        String absolutePath = Objects.requireNonNull(clazz.getClassLoader().getResource("")).getPath();
        String packagePath = clazz.getPackage().getName().replace(".",File.separator);
        String className = clazz.getSimpleName();

        String realPath = ("\\".equals(File.separator) ? absolutePath.substring(1) : absolutePath) + packagePath + File.separator + className + ".class";
        ClassFile classFile = ClassRead.read(realPath);
        classFile.toDisplay();
    }
}
